﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelLayer;
using DBLayer;

namespace CtrLayer
{
    public class ShowController
    {
        private IShowDB showDb = new ShowDBClient();

        public Show GetShow(int id)
        {
            return showDb.GetShow(id);
        }

        public Show GetShow(DateTime dateTime)
        {
            return showDb.GetShow(dateTime);
        }

        public List<Show> GetShows(DateTime dateTimeStart, DateTime dateTimeEnd)
        {
            return showDb.GetShows(dateTimeStart, dateTimeEnd);
        }

        public int AddShow(Show show)
        {
            return showDb.InsertShow(show);
        }

        public int InsertShow(Show s)
        {
            try
            {
                return showDb.InsertShow(s);
            }
            catch (ArgumentNullException e)
            {
                throw;
            }
        }

        public int DeleteShow(int id)
        {
            return showDb.DeleteShow(id);
        }

        public List<Show> FindShowsByMovie(Movie m)
        {
            return showDb.GetShows(m);
        }

        public List<Show> FindShowsByDate(DateTime d)
        {
            return showDb.FindShowsByDate(d);
        }
    }
}

